#ifndef VPPACKETQUEUE_H
#define VPPACKETQUEUE_H

#include <vppacket.h>
#include <condition_variable>
#include <QList>
class VpPacketQueue
{
private:
    int                m_serial;
    int                m_stream_idx;
    bool               m_stop;
    QList<VpPacket>    m_list;

public:
    AVCodecContext*    m_codec_ctx;
    condition_variable m_cond;
    mutex              m_mutex;


public:
             VpPacketQueue ();
            ~VpPacketQueue ();
    void     push          (VpPacket &elem);
    VpPacket pop           ();
    void     flush_queue   ();
    void     setSerial     (int newSerial);
    int      get_size      ();
    int      serial        () const;
    int      stream_idx    () const;
    void     setStream_idx (int newStream_idx);
    void     stop          ();
    void     start         ();
};

#endif // VPPACKETQUEUE_H
